import { View } from '@tarojs/components';
import Taro from '@tarojs/taro';
import React from 'react';
import styles from './index.module.scss';

const goActivityPage = ({ activityId, merchantId, orgId }) => {
  Taro.navigateTo({
    url: `/giftCardSubPack/salesPromotion/index?id=${activityId}&merchantId=${merchantId}&orgId=${orgId}`,
  });
};

const ViewMore = ({ activity, products }) => {
  if (!products?.length) {
    return null;
  }

  return (
    <View
      className={styles.ViewMore}
      onClick={() => {
        goActivityPage(activity);
      }}
    >
      <View className="txt">查看更多</View>
    </View>
  );
};

export default ViewMore;
